home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000072_Martyn.Johnson@cl.cam.ac.uk_Fri Oct 22 11:23:51 1993.msg < prev    next >
Internet Message Format  |  1994-10-11  |  2KB

  1. Received: from swan.cl.cam.ac.uk by cs.umb.edu with SMTP id AA25628
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Fri, 22 Oct 1993 05:24:55 -0400
  3. Received: from ashby.cl.cam.ac.uk (user maj (rfc931)) by swan.cl.cam.ac.uk 
  4.           with SMTP (PP-6.5) to cl; Fri, 22 Oct 1993 10:24:33 +0100
  5. To: tex-k@cs.umb.edu
  6. Cc: Martyn.Johnson@cl.cam.ac.uk
  7. Subject: Problem with EPSF handling in xdvik 1.3 - improved solution
  8. Date: Fri, 22 Oct 93 10:23:51 +0100
  9. From: Martyn Johnson <Martyn.Johnson@cl.cam.ac.uk>
  10. Message-Id: <"swan.cl.cam.:121540:931022092439"@cl.cam.ac.uk>
  11.  
  12. I posted a message yesterday about a problem with xdvik's EPSF handling
  13. failing because of SIGIO interrupting the call of "system". I later
  14. realised that the same problem can afflict MakeTeXPK processing, and my
  15. patch does not solve that.
  16.  
  17. I should perhaps have pointed out that the platform on which I
  18. discovered the problem is DEC Alpha running OSF/1.  Unlike many other
  19. systems, this does not retry interrupted "wait" system calls by default.
  20. However, this default can be overridden, and this leads to some much
  21. better solutions to the problem.
  22.  
  23. Solution 1:
  24.  
  25.   Link with the -lbsd library. This causes reversion to the old BSD
  26. semantics.
  27.  
  28. Solution 2:
  29.  
  30.   Use "sigaction" rather than "signal", and set the SA_RESTART flag
  31. explicitly.  I prefer this approach, because not all vendors may
  32. follow Digital's approach of offering a whole family of alternative
  33. compatibility modes.  A possible patch would be:
  34.  
  35. *** 1.1 1993/10/21 14:06:44
  36. --- xdvi.c      1993/10/22 08:43:59
  37. ***************
  38. *** 2026,2032 ****
  39. --- 2026,2036 ----
  40.             if (dup2(socket, 0) == -1) perror(prog);
  41.             socket = 0;
  42.         }
  43. + #ifdef SA_RESTART
  44. +       (void) sigaction(SIGIO, (handle_intr, 0, SA_RESTART), NULL);
  45. + #else
  46.         (void) signal(SIGIO, handle_intr);
  47. + #endif SA_RESTART
  48.         (void) fcntl(socket, F_SETOWN, getpid());
  49.         (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
  50.   }
  51.  
  52.  
  53. It might be better to test explictly for the presence of "sigaction"
  54. in the configure stuff, rather than #ifdef'ing on SA_RESTART.
  55.  
  56. Martyn Johnson      maj@cl.cam.ac.uk
  57. University of Cambridge Computer Lab
  58. Cambridge UK